package Day10;

import Day05.Rabbit;

public class GirlFriends {
    public String name;
    public int age;

    public GirlFriends() {
    }

    public GirlFriends(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) throws  RuntimeException{
        int len = name.length();
        if(len < 3 || len > 10){
            throw new  RuntimeException();
        }
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) throws RuntimeException {
        if(age < 18 || age > 40){
            throw new RuntimeException();
        }
        this.age = age;
    }
}
